Skip to content

Conversation

@cderv
Copy link
Collaborator

@cderv cderv commented Oct 6, 2025

sidebar.logo is now normalized as an object with light and dark properties

So sidebar.logo is never undefined - it may have light or dark undefined, but the object itself exists.

fix #13506

@posit-snyk-bot
Copy link
Collaborator

posit-snyk-bot commented Oct 6, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Licenses 0 0 0 0 0 issues
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@cderv cderv force-pushed the fix/nologo-sidebar branch from 91be50e to 9c645b4 Compare October 10, 2025 18:52
@cderv
Copy link
Collaborator Author

cderv commented Oct 10, 2025

While trying to add some tests, I am now wondering how we are supposed to pass logo when we do hybrid navigation: https://quarto.org/docs/websites/website-navigation.html#hybrid-navigation

  • one logo per sidebar ?
  • one logo for all sidebar ?

🤔

@gordonwoodhull
Copy link
Contributor

As discussed, we are only resolving the logos in sidebars[0], but we should probably resolve logos in all sidebars:

let sideLogo = sidebars[0].logo;
if (sideLogo) {
if (sidebars[0][kLogoAlt]) {
const alt = sidebars[0][kLogoAlt];
if (typeof sideLogo === "string") {
sideLogo = { path: sideLogo, alt };
}
// possible but absurd
// else if ("path" in sideLogo) {
// sideLogo = { ...sideLogo, alt };
// } else {
// sideLogo = {
// light: !sideLogo.light ? undefined : typeof sideLogo.light === "string"
// ? {
// path: sideLogo.light,
// alt,
// }
// : { ...sideLogo.light, alt },
// dark: !sideLogo.dark ? undefined : typeof sideLogo.dark === "string"
// ? {
// path: sideLogo.dark,
// alt,
// }
// : { ...sideLogo.dark, alt },
// };
// }
}
}
let logo = resolveLogo(projectBrand, sideLogo, [
"medium",
"small",
"large",
]);
logo = logoAddLeadingSlashes(logo, projectBrand, undefined);
sidebars[0].logo = logo;

@cderv
Copy link
Collaborator Author

cderv commented Oct 16, 2025

Thanks. That is explaining it ! Surely not clear from the doc !

I think I'll handle it in another issue

@cderv cderv force-pushed the fix/nologo-sidebar branch from 9c645b4 to 526d074 Compare October 16, 2025 13:49
@cderv
Copy link
Collaborator Author

cderv commented Oct 16, 2025

setting sidebar.logo to undefined required to properly handle the logo in Typst Lua brand support. Our test caught it which is cool!

@cderv cderv marked this pull request as ready for review October 16, 2025 15:25
@cderv cderv merged commit 15b4845 into main Oct 16, 2025
51 checks passed
@cderv cderv deleted the fix/nologo-sidebar branch October 16, 2025 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Active nav is no more the right one when the page has a sidebar

4 participants